/*
 * Category.java
 *
 * Created on October 28, 2009, 6:22 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package agendaBD;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 *
 * @author godinho
 */
public class Category {
    
    private String categoryName = "";
    
    private List<Contato> contatos = new ArrayList<Contato>();
    
    /** Creates a new instance of Category */
    public Category(String c) {
        this.setCategoryName(c);
    }
    
    public String getCategoryName(){
        return this.categoryName;
    }
    
    public void setCategoryName(String categoryName){
        this.categoryName = categoryName;
    }
    
    public void addContato(Contato c){
        this.contatos.add(c);
    }
    
    public boolean removeContato(Contato c){
        return this.contatos.remove(c);
    }
    
    public Contato getContato(int index){
        return this.contatos.get(index);
    } 
    
    public int getContatoCount(){
        return this.contatos.size();
    }
    
    public int indexOfContato(Contato c){
        return this.contatos.indexOf(c);
    }
    
    public void insertContato(Contato c, int index){
        this.contatos.set(index, c);
    }
    
    public String toString(){
        return this.categoryName;
    }
    
}
